//
//  wangzhantixingViewController.m
//  个人信息
//
//  Created by IOSchengxuyuan on 15/12/7.
//  Copyright © 2015年 com.ppfur. All rights reserved.
//

#import "wangzhantixingViewController.h"

@interface wangzhantixingViewController (){
    float aa,bb;
    float width,height;
    UITableViewCell*cell;
    UIButton*bb1;
    UIButton*bb2;
    UIButton*bb3;
    UIButton*bb4;
    UIButton*bb5;
    UIButton*bb6;
    UIButton*bb7;
    UIButton*bb8;
    UIButton*bb9;
    UIButton*bb10;
    UIButton*bb11;
    UIButton*bb12;
    UIButton*bb13;
    UIButton*bb14;
    UIButton*bb15;
    
    int m;
}

@end

@implementation wangzhantixingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _mytable.delegate=self;
    _mytable.dataSource=self;
    width=[UIScreen mainScreen].bounds.size.width;
    height=[UIScreen mainScreen].bounds.size.height;
    aa=width/320;
    bb=height/568;
    _mytable.frame=CGRectMake(0, 0, width, height);
    _mytable.scrollEnabled=NO;
    m=0;
    // Do any additional setup after loading the view.
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 3;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    if (section==0) {
        return 1;
    }else if (section==1){
        return 4;
    }else{
        return 2;
    }
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    if(width==375){
        if (section!=2) {
            return 5;
        }else{
            return 240;
        }
    }else if(width==320){
        if (section!=2) {
            return 5;
        }else{
            return 140;
        }
    }else {
        if (section!=2) {
            return 5;
        }else{
            return 310;
        }
        
    }
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *id=@"row";
    cell=[tableView dequeueReusableCellWithIdentifier:id];
    if (cell==nil)
    {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:id];
    }
    NSArray *row1=[cell.contentView subviews];
//    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    for (UIView *vv2 in row1)
    {
        [vv2 removeFromSuperview];
    }
    if (indexPath.section==0){
        if (indexPath.row==0) {
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(10*aa, 13*bb, 120, 20)];
            ll1.text=@"宝贝管理通知";
            ll1.font=[UIFont systemFontOfSize:14.0f];
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(160*aa, 13*bb, 80, 20)];
            ll2.text=@"站内信";
            ll2.font=[UIFont systemFontOfSize:14.0f];
            [cell.contentView addSubview:ll2];
            UILabel*ll3=[[UILabel alloc] initWithFrame:CGRectMake(230*aa, 13*bb, 50, 20)];
            ll3.text=@"邮箱";
            ll3.font=[UIFont systemFontOfSize:14.0f];
            [cell.contentView addSubview:ll3];
            UILabel*ll4=[[UILabel alloc] initWithFrame:CGRectMake(280*aa, 13*bb, 50, 20)];
            ll4.text=@"手机";
            ll4.font=[UIFont systemFontOfSize:14.0f];
            [cell.contentView addSubview:ll4];
        }
    }else if(indexPath.section==1){
        if (indexPath.row==0) {
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(20*aa, 13*bb, 150, 20)];
            ll1.text=@"宝贝被移除请通知我";
            ll1.font=[UIFont systemFontOfSize:13.0f];
            [cell.contentView addSubview:ll1];
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(5*aa, 15*bb, 30, 20)];
            ll2.text=@"*";
            ll2.font=[UIFont systemFontOfSize:16.0f];
            ll2.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll2];
            bb1=[[UIButton alloc] initWithFrame:CGRectMake(175*aa, 15*bb, 15, 15)];
            [bb1.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb1 addTarget:self action:@selector(yi:) forControlEvents:UIControlEventTouchUpInside];
            [bb1.layer setBorderWidth:1.0f];
            bb1.layer.cornerRadius=3.0f;
            [cell.contentView addSubview:bb1];
            bb2=[[UIButton alloc] initWithFrame:CGRectMake(235*aa, 15*bb, 15, 15)];
            [bb2.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb2.layer setBorderWidth:1.0f];
            [bb2 addTarget:self action:@selector(er:) forControlEvents:UIControlEventTouchUpInside];
            bb2.layer.cornerRadius=3.0f;
            [cell.contentView addSubview:bb2];
            bb3=[[UIButton alloc] initWithFrame:CGRectMake(290*aa, 15*bb, 15, 15)];
            [bb3.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb3.layer setBorderWidth:1.0f];
            [bb3 addTarget:self action:@selector(san:) forControlEvents:UIControlEventTouchUpInside];
            bb3.layer.cornerRadius=3.0f;
            [cell.contentView addSubview:bb3];
        }
        else if(indexPath.row==1){
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(20*aa, 13*bb, 150, 20)];
            ll1.text=@"宝贝被移除请通知我";
            ll1.font=[UIFont systemFontOfSize:13.0f];
            [cell.contentView addSubview:ll1];
            
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(5*aa, 15*bb, 30, 20)];
            ll2.text=@"*";
            ll2.font=[UIFont systemFontOfSize:16.0f];
            ll2.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll2];
            bb4=[[UIButton alloc] initWithFrame:CGRectMake(175*aa, 15*bb, 15, 15)];
            [bb4.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb4 addTarget:self action:@selector(si:) forControlEvents:UIControlEventTouchUpInside];
            [bb4.layer setBorderWidth:1.0f];
            bb4.layer.cornerRadius=3.0f;
            [cell.contentView addSubview:bb4];
            bb5=[[UIButton alloc] initWithFrame:CGRectMake(235*aa, 15*bb, 15, 15)];
            [bb5.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb5.layer setBorderWidth:1.0f];
            bb5.layer.cornerRadius=3.0f;
            [bb5 addTarget:self action:@selector(wu:) forControlEvents:UIControlEventTouchUpInside];
            [cell.contentView addSubview:bb5];
            
           bb6=[[UIButton alloc] initWithFrame:CGRectMake(290*aa, 15*bb, 15, 15)];
            [bb6.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb6.layer setBorderWidth:1.0f];
            bb6.layer.cornerRadius=3.0f;
            [bb6 addTarget:self action:@selector(liu:) forControlEvents:UIControlEventTouchUpInside];
            [cell.contentView addSubview:bb6];
        }else  if(indexPath.row==2){
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(20*aa, 13*bb, 150, 20)];
            ll1.text=@"宝贝被移除请通知我";
            ll1.font=[UIFont systemFontOfSize:13.0f];
            [cell.contentView addSubview:ll1];
            
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(5*aa, 15*bb, 30, 20)];
            ll2.text=@"*";
            ll2.font=[UIFont systemFontOfSize:16.0f];
            ll2.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll2];
            bb7=[[UIButton alloc] initWithFrame:CGRectMake(175*aa, 15*bb, 15, 15)];
            [bb7.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb7.layer setBorderWidth:1.0f];
            bb7.layer.cornerRadius=3.0f;
            [bb7 addTarget:self action:@selector(qi:) forControlEvents:UIControlEventTouchUpInside];
            [cell.contentView addSubview:bb7];
           bb8=[[UIButton alloc] initWithFrame:CGRectMake(235*aa, 15*bb, 15, 15)];
            [bb8.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb8.layer setBorderWidth:1.0f];
            [bb8 addTarget:self action:@selector(ba:) forControlEvents:UIControlEventTouchUpInside];
            bb8.layer.cornerRadius=3.0f;
            [cell.contentView addSubview:bb8];
            
            bb9=[[UIButton alloc] initWithFrame:CGRectMake(290*aa, 15*bb, 15, 15)];
            [bb9.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb9.layer setBorderWidth:1.0f];
            bb9.layer.cornerRadius=3.0f;
            [bb9 addTarget:self action:@selector(jiu:) forControlEvents:UIControlEventTouchUpInside];
            [cell.contentView addSubview:bb9];
        }else{
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(10*aa, 13*bb, 100*aa, 20*bb)];
            ll1.text=@"成交通知";
            ll1.font=[UIFont systemFontOfSize:14.0f];
            [cell.contentView addSubview:ll1];
        }
    }else if(indexPath.section==2){
        if (indexPath.row==0) {
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(20*aa, 13*bb, 150, 20)];
            ll1.text=@"宝贝被移除请通知我";
            ll1.font=[UIFont systemFontOfSize:13.0f];
            [cell.contentView addSubview:ll1];
            
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(5*aa, 15*bb, 30, 20)];
            ll2.text=@"*";
            ll2.font=[UIFont systemFontOfSize:16.0f];
            ll2.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll2];
            bb10=[[UIButton alloc] initWithFrame:CGRectMake(175*aa, 15*bb, 15, 15)];
            [bb10.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb10.layer setBorderWidth:1.0f];
            bb10.layer.cornerRadius=3.0f;
            [bb10 addTarget:self action:@selector(shi:) forControlEvents:UIControlEventTouchUpInside];
            [cell.contentView addSubview:bb10];
            bb11=[[UIButton alloc] initWithFrame:CGRectMake(235*aa, 15*bb, 15, 15)];
            [bb11.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb11.layer setBorderWidth:1.0f];
            bb11.layer.cornerRadius=3.0f;
            [bb11 addTarget:self action:@selector(shiyi:) forControlEvents:UIControlEventTouchUpInside];
            [cell.contentView addSubview:bb11];
            
            bb12=[[UIButton alloc] initWithFrame:CGRectMake(290*aa, 15*bb, 15, 15)];
            [bb12.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb12.layer setBorderWidth:1.0f];
            bb12.layer.cornerRadius=3.0f;
            [bb12 addTarget:self action:@selector(shier:) forControlEvents:UIControlEventTouchUpInside];
            [cell.contentView addSubview:bb12];
            
        }else{
            UILabel*ll1=[[UILabel alloc] initWithFrame:CGRectMake(20*aa, 13*bb, 150, 20)];
            ll1.text=@"宝贝被移除请通知我";
            ll1.font=[UIFont systemFontOfSize:13.0f];
            [cell.contentView addSubview:ll1];
            
            UILabel*ll2=[[UILabel alloc] initWithFrame:CGRectMake(5*aa, 15*bb, 30, 20)];
            ll2.text=@"*";
            ll2.font=[UIFont systemFontOfSize:16.0f];
            ll2.textColor=[UIColor redColor];
            [cell.contentView addSubview:ll2];
           bb13=[[UIButton alloc] initWithFrame:CGRectMake(175*aa, 15*bb, 15, 15)];
            [bb13.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb13.layer setBorderWidth:1.0f];
            bb13.layer.cornerRadius=3.0f;
            [bb13 addTarget:self action:@selector(shisan:) forControlEvents:UIControlEventTouchUpInside];
            [cell.contentView addSubview:bb13];
            bb14=[[UIButton alloc] initWithFrame:CGRectMake(235*aa, 15*bb, 15, 15)];
            [bb14.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb14.layer setBorderWidth:1.0f];
            bb14.layer.cornerRadius=3.0f;
            [bb14 addTarget:self action:@selector(shisi:) forControlEvents:UIControlEventTouchUpInside];
            [cell.contentView addSubview:bb14];
            
           bb15=[[UIButton alloc] initWithFrame:CGRectMake(290*aa, 15*bb, 15, 15)];
            [bb15.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
            [bb15.layer setBorderWidth:1.0f];
            bb15.layer.cornerRadius=3.0f;
            [bb15 addTarget:self action:@selector(shiwu:) forControlEvents:UIControlEventTouchUpInside];
            [cell.contentView addSubview:bb15];
        }
    }
    return cell;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)yi:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb1 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb1 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)er:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb2 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb2 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)san:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb3 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb3 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)si:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb4 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb4 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)wu:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb5 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb5 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)liu:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb6 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb6 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)qi:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb7 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb7 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)ba:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb8 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb8 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)jiu:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb9 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb9 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)shi:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb10 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb10 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)shiyi:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb11 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb11 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)shier:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb12 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb12 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)shisan:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb13 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb13 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)shisi:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb14 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb14 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
-(void)shiwu:(UIButton *)button{
    m=1;
    button.selected = !button.selected;
    if (button.selected == YES) {
        [bb15 setBackgroundImage:[UIImage imageNamed:@"yj1.png"] forState:UIControlStateNormal];
    }else if(button.selected ==NO ){
        [bb15 setBackgroundImage:[UIImage imageNamed:@"nil"] forState:UIControlStateNormal];
    }
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
